//AccountBaseQuesrRequest.java
package com.lqjava.flowable.beans.entity.request;
import com.lqjava.flowable.beans.entity.request.common.*;
import com.lqjava.flowable.beans.entity.domain.AccountBase;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.util.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;


/**
* 账户基础查询请求对象
* 用于描述账户的基础信息
* @author lq 2021-03-21 18:01:05
*/
@Getter
@Setter
@ToString
public class AccountBaseQuesrRequest extends PageRequest<AccountBase>{

    // 自增主键
    private Long id;
    private List<Long> idList = new ArrayList<>();;
    private Long idStart;
    private Long idEnd;

    // 创建人id
    private Long creatorid;
    private List<Long> creatoridList = new ArrayList<>();;


    // 创建时间
    private String createdDateTime;
    private String createdDateTimeStart;
    private String createdDateTimeEnd;

    // 最后修改人id
    private Long modifierid;
    private List<Long> modifieridList = new ArrayList<>();;


    // 最后修改时间
    private String modificationDateTime;
    private String modificationDateTimeStart;
    private String modificationDateTimeEnd;

    // 是否启用 1启用 0未启用
    private Integer enabled;

    // 是否启删除 1删除 0未删除
    private Integer deleted;

    // 账号
    private String account;




    public LambdaQueryWrapper<AccountBase> getQueryWrapper(){
        LambdaQueryWrapper<AccountBase> wrapper = new LambdaQueryWrapper<>();

        if(this.id != null){
            wrapper.eq(AccountBase::getId,this.id);
        }
        if(this.idList != null && this.idList.size() > 0){
            wrapper.in(AccountBase::getId,this.idList);
        }
        if(this.idStart != null && this.idEnd != null){
            wrapper.between(AccountBase::getId,this.idStart,this.idEnd);
        }

        if(this.creatorid != null){
            wrapper.eq(AccountBase::getCreatorid,this.creatorid);
        }
        if(this.creatoridList != null && this.creatoridList.size() > 0){
            wrapper.in(AccountBase::getCreatorid,this.creatoridList);
        }


        if(this.createdDateTimeStart != null && this.createdDateTimeEnd != null){
            wrapper.between(AccountBase::getCreatedDateTime,this.createdDateTimeStart,this.createdDateTimeEnd);
        }

        if(this.modifierid != null){
            wrapper.eq(AccountBase::getModifierid,this.modifierid);
        }
        if(this.modifieridList != null && this.modifieridList.size() > 0){
            wrapper.in(AccountBase::getModifierid,this.modifieridList);
        }


        if(this.modificationDateTimeStart != null && this.modificationDateTimeEnd != null){
            wrapper.between(AccountBase::getModificationDateTime,this.modificationDateTimeStart,this.modificationDateTimeEnd);
        }

        if(this.enabled != null){
            wrapper.eq(AccountBase::getEnabled,this.enabled);
        }

        if(this.deleted != null){
            wrapper.eq(AccountBase::getDeleted,this.deleted);
        }

        if(this.account != null){
            wrapper.eq(AccountBase::getAccount,this.account);
        }


        return wrapper;
    }

}
